#include "../header/header.h"z

struct timeval tempo(void) {
    
    struct timeval ret;
    
    if(gettimeofday(&ret, NULL) < 0) {
        fprintf(stderr, "Impossivel adquirir tempo!\n");
        exit(1);
    }
    
    return ret;
}

double difftempo(struct timeval final, struct timeval inicial) {

    double tfinal, tinicial;
    
    tfinal = (double)final.tv_sec + final.tv_usec/(double)1000000;
    tinicial = (double)inicial.tv_sec + inicial.tv_usec/(double)1000000;
    
    return (tfinal - tinicial);
}


